; Disassembly of the file "z:\ramdisk\home\knoppix\none\MASTERY_BOOT_2K_COBRA_80K.bin"
; 
; CPU Type: Z80
; 
; Created with dZ80 2.0
; 
; on Friday, 17 of May 2013 at 10:52 PM
; 
;				############################## START ROUTINE ####################################
;
0000           LD      A,$83	; bit 7 = "1"
0002           LD      R,A	; u36/5 kept at "1" after NPOR="0", so the computer stays in the startup hw config
0004           LD      SP,$FD73	; set stack at FD73
0007           LD      HL,$C000	; *0* C000 is the start addr for video mem in startup hw configuration (C0->40 @ 0009)
000A           LD      DE,$C001	; *1* C001 is the start addr+1 for video mem in startup hw configuration (C0->40 @ 000C)
000D           LD      BC,$1BFF	; 1AFF+1 is the standard total size of Spectrum video memory
0010           LD      (HL),$00	; this will fill up all video memory with zeros when the LDIR below executes
0012           LDIR
0014           LD      HL,$0000	; start address of this BOOT EPROM code					---@@@0016:00->28
0017           LD      DE,$8000	; start address of DRAM#0 in the startup config
001A           LD      BC,$0800	; 0800h (2K) is the length of this BOOT EPROM code
001D           LDIR		; entire BOOT EPROM code is copied from EPROM into DRAM#0
001F           LD      A,$03	; channel control word for Z80CTC, used in the next 4 instructions:
;				; (Disable Interrupt, Timer mode, Prescaler=16, CLK/TRG Falling Edge,
;				; Auto Trigger, No Time Const. Follows, Reset Channel)
0021           OUT     ($E3),A	; reset CTC channel 0
0023           OUT     ($EB),A	; reset CTC channel 1
0025           OUT     ($F3),A	; reset CTC channel 2
0027           OUT     ($FB),A	; reset CTC channel 3
0029           XOR     A	; set A register to "00"
002A           OUT     ($FD),A	; write "00" to 8272 Data Register (invalid command, places 8272 in standby)
002C           LD      A,$92	; control word for 8255: Mode Set flag=active,
;				; 			Group A: Select Mode 0,
;				;				 Port A set to Input mode,
;				;				 Port C (upper half) set to Output Mode,
;				;			Group B: Select Mode 0,
;				;				 Port B set to Input Mode,
;				;				 Port C (lower half) set to Output Mode
002E           OUT     ($DF),A	; write control word to 8255
0030           OUT     ($DF),A	; write control word to 8255 (again !?)
0032           LD      A,$40
0034           OUT     ($FE),A	; write 40 to port C of 8255
;				; (set border to black, set signal "SO" to 0, set signal "O5" to 0,
;				;  set signal "O6" to 1 to allow access to video memory in the hw startup config)
0036           JR      $0056	;###################### START ROUTINE CONTINUES AT 0056 #########################
;
;				############################## BASIC CONFIGURATION ##############################
;
0038           LD      HL,$4000	; 4000 is the start addr of BASIC EPROM in the startup hw config
003B           LD      DE,$8000	; 8000 is the start addr of DRAM#0 in the startup hw config
003E           LD      BC,$4000	; 4000 is the length of the SPECTRUM BASIC code (16 KB)
0041           LDIR		; copy SPECTRUM BASIC code into DRAM#0
0043           EXX		; (after EXX, HL contains 0000, see line 07F4)
0044           LD      A,$03	;	SAME AS	]
0046           OUT     ($E3),A	;		]
0048           OUT     ($EB),A	;	001F	]
004A           OUT     ($F3),A	;		]
004C           OUT     ($FB),A	;	 to	]
004E           XOR     A	;		]
004F           OUT     ($FD),A	;	002A	]
0051           OUT     ($FE),A	; write 03 to port C of 8255
;				; (set border to white, set signal "SO" to 0, set signal "O5" to 0,
;				;  set signal "O6" to 0)
0053           LD      R,A	; set bit 7 of R to 0, prepare for BASIC hardware configuration
0055           JP      (HL)	; change hardware configuration with a jump to (HL)
;
;				############################# END OF BASIC CONFIGURATION ########################
;
;				; ###################### START ROUTINE CONTINUED ################################
0056           LD      IX,$0390	; data table base address (0390-03C9)					---@@@0059:03->2B
005A           LD      C,$1D
005C           LD      B,(IX+$01) ; <--- <--- <--- <----|
005F           LD      HL,$03C2	; another data table base addr (03CA to 03CA+9*8-1=0411)		---@@@0061:03->2B
0062           LD      DE,$0008	;			|
0065           ADD     HL,DE	; <-----|		|
0066           DJNZ    $0065	; ----->|		|
0068           LD      E,(IX+$00) ;			|
006B           LD      D,$C8	; C800=start of mid. third serial video mem
006D           LD      B,$08	;			|
006F           LD      A,(HL)	; <-----|		|
0070           LD      (DE),A	;	|		|
0071           INC     D	;	|		|
0072           INC     HL	;	|		|
0073           DJNZ    $006F	; ----->|8 loops	|
0075           INC     IX	;			|
0077           INC     IX	;			|
0079           DEC     C	;			|
007A           JR      NZ,$005C	; ---> ---> ---> ------>|29 loops (1Dh)
007C           LD      IX,$0432	; data table								---@@@007F:04->2C
0080           LD      DE,$4D56
0083           CALL    $00BB	;									---@@@0085:00->28
0086           LD      DE,$AAB9
0089           CALL    $00BB	;									---@@@008B:00->28
008C           LD      HL,$D900
008F           LD      DE,$D901
0092           LD      BC,$009E
0095           LD      (HL),$42
0097           LDIR
0099           LD      (HL),$41
009B           LD      BC,$005D
009E           LDIR
00A0           LD      HL,$D966
00A3           LD      BC,$0441
00A6           LD      (HL),C	; <---|
00A7           INC     HL	;     |
00A8           DJNZ    $00A6	; --->|
00AA           INC     HL
00AB           LD      (HL),C
00AC           LD      HL,$D986
00AF           LD      (HL),C
00B0           INC     C
00B1           LD      HL,$D9A8
00B4           LD      (HL),C
00B5           LD      HL,$D9C8
00B8           LD      (HL),C
00B9           JR      $00DC	; ############## CONTINUES AT 00DC ##############

				; ###########
				; reads from table indexed by IX and
				; writes in the mid. third serial video mem
				; at displacement in register D
00BB           LD      C,$03
00BD           LD      L,D	; <--- <--- <--- <--- <--- <----|
00BE           LD      H,$C8	; <--- <--- <--- <---|		| C800=serial video mem
00C0           LD      B,$04	;		     |		|
00C2           INC     H	; <-----|	     |		|
00C3           LD      A,(IX+$00) ;	|	     |		|
00C6           LD      (HL),A	;	|	     |		|
00C7           INC     IX	;	|	     |		|
00C9           INC     H	;	|	     |		|
00CA           DJNZ    $00C2	; ----->|4 loops     |		|
00CC           INC     L	;		     |		|
00CD           LD      A,E	;		     |		|
00CE           CP      L	;		     |		|
00CF           JR      NZ,$00BE	; ---> ---> ---> --->|		|
00D1           ADD     A,$20	;				|
00D3           LD      E,A	;				|
00D4           LD      A,D	;				|
00D5           ADD     A,$20	;				|
00D7           LD      D,A	;				|
00D8           DEC     C	;				|
00D9           JR      NZ,$00BD	; ---> ---> ---> ---> ---> ---->|3 loops
00DB           RET

00DC           LD      IX,$DB00	; ######## CONTINUED <----| FROM 00B9 #############
00E0           LD      B,$10	;			  |
00E2           PUSH    BC	; <--- <---|		  |
00E3           LD      A,(IX+$02) ;	   |		  |
00E6           OR      A	;	   |		  |
00E7           JR      Z,$0122	; ---> -------->|	  |
00E9           DEC     (IX+$02)	;	   |	|	  |
00EC           LD      B,$06	;	   | <--- <--- <--- <---|
00EE           INC     IX	; <---|	   |	|	  |	|
00F0           DJNZ    $00EE	; --->|	   |	|	  |	|
00F2           POP     BC	;	   |	|	  |	|
00F3           DJNZ    $00E2	; ---> --->|	|	  |	|
00F5           LD      A,$7F	; KA15		|	  |	|
00F7           IN      A,($FE)	;		|	  |	|
00F9           AND     $10	; "B"		|	  |	|
00FB           JP      Z,$07F0	; BASIC		|	  |	|					---@@@00FD:07->2F
00FE           LD      A,$DF	; KA13		|	  |	|
0100           IN      A,($FE)	;		|	  |	|
0102           AND     $02	; "O"		|	  |	|
0104           JP      Z,$07F4	; OPUS		|	  |	|					---@@@0106:07->2F
0107           LD      A,$FD	; KA9		|	  |	|
0109           IN      A,($FE)	;		|	  |	|
010B           AND     $04	; "D"		|	  |	|
010D           JP      Z,$0552	; CP/M		|	  |	|					---@@@010F:05->2D
0110           LD      A,$BF	; KA14		|	  |	|
0112           IN      A,($FE)	;		|	  |	|
0114           AND     $02	; "L"		|	  |	|
0116           JP      Z,$01EA	;		|	  |	|					---@@@0118:01->29
0119           IN      A,($DF)	; port B 8255	|	  |	|
011B           AND     $10	; bit 4		|	  |	|
011D           JP      NZ,$01EA	;		|	  |	|					---@@@011F:01->29
0120           JR      $00DC	; ---> ---> -----> ------>|	|
0122           CALL    $01D3	; <--- <--- <---|		|					---@@@0124:01->29
0125           LD      A,($F7FF) ;				|
0128           CP      $F0	;				|
012A           JR      C,$0134	;				|
012C           LD      A,(IX+$04) ;				|
012F           XOR     $01	;				|
0131           LD      (IX+$04),A ;				|
0134           CALL    $01D3	;				|					---@@@0136:01->29
0137           LD      A,($F7FF) ;				|
013A           AND     $7F	;				|
013C           LD      (IX+$02),A ;				|
013F           LD      A,(IX+$05) ;				|
0142           OR      A	;				|
0143           JR      Z,$0163	;				|
0145           LD      A,(IX+$04) ;				|
0148           OR      A	;				|
0149           JR      Z,$015E	;				|
014B           LD      A,(IX+$05) ;				|
014E           INC     A	;				|
014F           CP      $04	;				|
0151           JR      Z,$0158	; ---> --->|			|
0153           INC     (IX+$05)	;	   |			|
0156           JR      $019F	; ---> -----> ---> ---->|	|
0158           LD      (IX+$04),$00 ;<-----|		V	|
015C           JR      $019F	; ---> ---> ---> ------>|	|
015E           DEC     (IX+$05)	;			V	|
0161           JR      $019F	; ---> ---> ---> ------>|	|
0163           LD      A,$01	;			|	|
0165           LD      (IX+$05),A ;			|	|
0168           LD      (IX+$04),A ;			|	|
016B           CALL    $01D3	; <---|			|	|					---@@@016D:01->29
016E           LD      A,($F7FF) ;    |			|	|
0171           AND     $47	;     |			|	|
0173           LD      C,A	;     |			|	|
0174           AND     $07	;     |			|	|
0176           CP      $07	;     |			|	|
0178           JR      Z,$016B	; --->|			|	|
017A           LD      (IX+$03),C ;			|	|
017D           CALL    $01D3	; <---|<--- <---|	|	|					---@@@017F:01->29
0180           LD      HL,($F7FE) ;   |		|	|	|
0183           LD      A,H	;     |		|	|	|
0184           AND     $18	;     |		|	|	|
0186           CP      $18	;     |		|	|	|
0188           JR      Z,$017D	; --->|		|	|	|
018A           OR      $C0	;		|	|	|
018C           LD      H,A	;		|	|	|
018D           PUSH    HL	;		|	|	|
018E           LD      B,$08	;		|	|	|
0190           XOR     A	;		|	|	|
0191           OR      (HL)	; <---|		|	|	|
0192           INC     H	;     |		|	|	|
0193           DJNZ    $0191	; --->|8 loops	|	|	|
0195           POP     HL	;		|	|	|
0196           OR      A	;		|	|	|
0197           JR      NZ,$017D	; ---> ---> --->|	|	|
0199           LD      (IX+$00),L ;			|	|
019C           LD      (IX+$01),H ;			|	|
019F           LD      HL,$0412	; <--- <--- <--- <------|	|					---@@@01A1:04->2C
01A2           LD      B,(IX+$05) ;				|
01A5           LD      A,B	;				|
01A6           OR      A	;				|
01A7           JR      Z,$01AF	; ---> ---> --->|		|
01A9           LD      DE,$0008	;		|		|
01AC           ADD     HL,DE	; <---|		|		|
01AD           DJNZ    $01AC	; --->|		|		|
01AF           EX      DE,HL	; <--- <--- <---|		|
01B0           LD      L,(IX+$00) ;				|
01B3           LD      H,(IX+$01) ;				|
01B6           LD      B,$08	;				|
01B8           LD      A,(DE)	; <---|				|
01B9           LD      (HL),A	;     |				|
01BA           INC     DE	;     |				|
01BB           INC     H	;     |				|
01BC           DJNZ    $01B8	; --->|				|
01BE           LD      A,(IX+$01) ;				|
01C1           RRC     A	;				|
01C3           RRC     A	;				|
01C5           RRC     A	;				|
01C7           AND     $03	;				|
01C9           OR      $D8	;				|
01CB           LD      H,A	;				|
01CC           LD      A,(IX+$03) ;				|
01CF           LD      (HL),A	;				|
01D0           JP      $00EC	; ---> ---> ---> ---> ---> ---->|					---@@@01D2:00->28
				; ########### F9D3 (in CP/M config)
01D3           PUSH    AF
01D4           PUSH    HL
01D5           PUSH    DE
01D6           PUSH    BC
01D7           LD      HL,($F7FE)
01DA           INC     HL
01DB           LD      D,H
01DC           LD      E,L
01DD           LD      B,$04
01DF           ADD     HL,DE
01E0           DJNZ    $01DF
01E2           LD      ($F7FE),HL
01E5           POP     BC
01E6           POP     DE
01E7           POP     HL
01E8           POP     AF
01E9           RET
				; ########### CP/M ###########
01EA           LD      HL,$01F2	; jump addr in new config (3 lines below)
01ED           LD      A,$41
01EF           JP      $0051	; O6=1, border=blue, change config to CP/M				---@@@01F1:00->28
				; continue to next line under CP/M hardware cfg
01F2           XOR     A	; A=00
01F3           OUT     ($FE),A	; O6=0, border=black
01F5           LD      HL,$0000	; * relocate this
01F8           LD      DE,$F800	; * BOOT code again
01FB           LD      BC,$0800	; * to F800-FFFF
01FE           LDIR		; *
0200           JP      $FA03	; continues with exactly next line at FA03
0203           DI
0204           CALL    $F9D3
0207           LD      HL,($F7FE)
020A           LD      ($FB0A),HL
020D           CALL    $F9D3
0210           LD      HL,($F7FE)
0213           LD      ($FB0C),HL
0216           CALL    $F9D3
0219           LD      HL,($F7FE)
021C           LD      ($FB0E),HL
021F           CALL    $FA4A
0222           CALL    $FA77
0225           JR      C,$021F
0227           LD      HL,$FB10
022A           LD      A,($FB0E)
022D           CP      (HL)
022E           JR      NZ,$021F
0230           INC     HL
0231           LD      A,($FB0F)
0234           CP      (HL)
0235           JR      NZ,$021F
0237           LD      A,($FB12)
023A           CP      $01
023C           JR      NZ,$021F
023E           LD      A,($FB13)
0241           OR      A
0242           JR      NZ,$021F
0244           CALL    $FAC0
0247           JP      $0000
				; ########## FA4A (in CP/M config)
024A           LD      HL,$FB06
024D           LD      BC,$0008
0250           PUSH    BC	; <--- <--- <--- <---|
0251           LD      D,$08	;		     |
0253           LD      E,(HL)	;		     |
0254           LD      B,$03	; <--- <--- <---|    |
0256           RLC     E	;		|    |
0258           JR      NC,$025C	; --->|		|    |
025A           LD      B,$0C	;     |		|    |
025C           LD      A,$80	; <---|		|    |
025E           OUT     ($FE),A	;		|    |
0260           DJNZ    $0260	;		|    |
0262           XOR     A	;		|    |
0263           NOP		;		|    |
0264           OUT     ($FE),A	;		|    |
0266           LD      B,$18	;		|    |
0268           DJNZ    $0268	;		|    |
026A           DEC     D	;		|    |
026B           JP      NZ,$FA54	; ---> ---> --->|    |
026E           POP     BC	;		     |
026F           INC     HL	;		     |
0270           DEC     BC	;		     |
0271           LD      A,B	;		     |
0272           OR      C	;		     |
0273           JP      NZ,$FA50	; ---> ---> ---> --->|
0276           RET
				; ########## FA77 (in CP/M config)
0277           LD      HL,$FB10
027A           LD      BC,$0004
027D           PUSH    BC	; <--- <--- <--- <---|
027E           LD      A,($FB14)	;	     |
0281           LD      C,A	;		     |
0282           LD      DE,$0800	;		     |
0285           IN      A,($FE)	; <--- <--- <---|    |
0287           AND     C	;		|    |
0288           JR      NZ,$02BD	; ----->|	|    |
028A           LD      B,$80	;	|	|    |
028C           IN      A,($FE)	;	|	|    |
028E           AND     C	;	|	|    |
028F           JP      NZ,$FA96	; --->|	|	|    |
0292           DJNZ    $028C	;     |	|	|    |
0294           JR      $02BD	;     |	|	|    |
0296           LD      B,$08	; <---|	|	|    |
0298           DJNZ    $0298	;	|	|    |
029A           IN      A,($FE)	;	|	|    |
029C           AND     C	;	|	|    |
029D           JP      Z,$FAA6	; --->|	|	|    |
02A0           SET     7,E	;     |	|	|    |
02A2           LD      B,$05	;     |	|	|    |
02A4           DJNZ    $02A4	;     |	|	|    |
02A6           RLC     E	; <---|	|	|    |
02A8           DEC     D	;	|	|    |
02A9           JP      NZ,$FA85	; ---> ---> --->|    |
02AC           IN      A,($FE)	;	|	     |
02AE           AND     C	;	V	     |
02AF           JR      NZ,$02BD	; ----->|	     |
02B1           LD      (HL),E	;	V	     |
02B2           POP     BC	;	|	     |
02B3           INC     HL	;	|	     |
02B4           DEC     BC	;	|	     |
02B5           LD      A,B	;	|	     |
02B6           OR      C	;	|	     |
02B7           JP      NZ,$FA7D	; ---> ---> ---> --->|
02BA           SCF		;	|
02BB           CCF		;	|
02BC           RET		;	|

02BD           POP     BC	; <-----|
02BE           SCF
02BF           RET
				; ########## FAC0 (in CP/M config)
02C0           LD      B,$00
02C2           IN      A,($FE)	; <--- <-----|
02C4           AND     $C0	;	     |
02C6           CP      $C0	;	     |
02C8           JR      NZ,$02CD	; --->|      |
02CA           DJNZ    $02C2	; -----> --->|
02CC           RET		;     |
				;     |
02CD           LD      HL,$0000	; <---|
02D0           LD      BC,$1000
02D3           PUSH    BC	; <--- <--- <---|
02D4           LD      BC,$8000	;		|
02D7           LD      DE,$0400	;		|
02DA           LD      A,C	; <---|		|
02DB           XOR     B	;     |		|
02DC           OUT     ($FE),A	;     |		|
02DE           LD      C,A	;     |		|
02DF           IN      A,($FE)	;     |		|
02E1           IN      A,($FE)	;     |		|
02E3           IN      A,($FE)	;     |		|
02E5           IN      A,($FE)	;     |		|
02E7           IN      A,($FE)	;     |		|
02E9           IN      A,($FE)	;     |		|
02EB           IN      A,($FE)	;     |		|
02ED           NOP		;     |		|
02EE           IN      A,($FE)	;     |		|
02F0           AND     $C0	;     |		|
02F2           OR      E	;     |		|
02F3           LD      E,A	;     |		|
02F4           RLC     E	;     |		|
02F6           RLC     E	;     |		|
02F8           DEC     D	;     |		|
02F9           JP      NZ,$FADA	; --->|		|
02FC           POP     BC	;		|
02FD           LD      (HL),E	;		|
02FE           INC     HL	;		|
02FF           DEC     BC	;		|
0300           LD      A,B	;		|
0301           OR      C	;		|
0302           JP      NZ,$FAD3	; ---> ---> --->|
0305           RET
				; ########## EMPTY SPACE ############
0306           DB      $01
0307           DB      $00
0308           DB      $00
0309           DB      $00
030A           DB      $00
030B           DB      $00
030C           DB      $00
030D           DB      $00
030E           DB      $00
030F           DB      $00
0310           DB      $00
0311           DB      $00
0312           DB      $00
0313           DB      $00
0314           DB      $80
0315           DB      $00
0316           DB      $00
0317           DB      $00
0318           DB      $00
0319           DB      $00
031A           DB      $00
031B           DB      $00
031C           DB      $00
031D           DB      $00
031E           DB      $00
031F           DB      $00
0320           DB      $00
0321           DB      $00
0322           DB      $00
0323           DB      $00
0324           DB      $00
0325           DB      $00
0326           DB      $00
0327           DB      $00
0328           DB      $00
0329           DB      $00
032A           DB      $00
032B           DB      $00
032C           DB      $00
032D           DB      $00
032E           DB      $00
032F           DB      $00
0330           DB      $00
0331           DB      $00
0332           DB      $00
0333           DB      $00
0334           DB      $00
0335           DB      $00
0336           DB      $00
0337           DB      $00
0338           DB      $00
0339           DB      $00
033A           DB      $00
033B           DB      $00
033C           DB      $00
033D           DB      $00
033E           DB      $00
033F           DB      $00
0340           DB      $00
0341           DB      $00
0342           DB      $00
0343           DB      $00
0344           DB      $00
0345           DB      $00
0346           DB      $00
0347           DB      $00
0348           DB      $00
0349           DB      $00
034A           DB      $00
034B           DB      $00
034C           DB      $00
034D           DB      $00
034E           DB      $00
034F           DB      $00
0350           DB      $00
0351           DB      $00
0352           DB      $00
0353           DB      $00
0354           DB      $00
0355           DB      $00
0356           DB      $00
0357           DB      $00
0358           DB      $00
0359           DB      $00
035A           DB      $00
035B           DB      $00
035C           DB      $00
035D           DB      $00
035E           DB      $00
035F           DB      $00
0360           DB      $00
0361           DB      $00
0362           DB      $00
0363           DB      $00
0364           DB      $00
0365           DB      $00
0366           DB      $00
0367           DB      $00
0368           DB      $00
0369           DB      $00
036A           DB      $00
036B           DB      $00
036C           DB      $00
036D           DB      $00
036E           DB      $00
036F           DB      $00
0370           DB      $00
0371           DB      $00
0372           DB      $00
0373           DB      $00
0374           DB      $00
0375           DB      $00
0376           DB      $00
0377           DB      $00
0378           DB      $00
0379           DB      $00
037A           DB      $00
037B           DB      $00
037C           DB      $00
037D           DB      $00
037E           DB      $00
037F           DB      $00
0380           DB      $00
0381           DB      $00
0382           DB      $00
0383           DB      $00
0384           DB      $00
0385           DB      $00
0386           DB      $00
0387           DB      $00
0388           DB      $00
0389           DB      $00
038A           DB      $00
038B           DB      $00
038C           DB      $00
038D           DB      $00
038E           DB      $00
038F           DB      $00
				; ########## DATA TABLE #1 ###########
0390           DB      $28
0391           DB      $05
0392           DB      $29
0393           DB      $02
0394           DB      $2A
0395           DB      $08
0396           DB      $2B
0397           DB      $02
0398           DB      $2C
0399           DB      $07
039A           DB      $48
039B           DB      $01
039C           DB      $4A
039D           DB      $01
039E           DB      $4C
039F           DB      $01
03A0           DB      $66
03A1           DB      $05
03A2           DB      $67
03A3           DB      $02
03A4           DB      $68
03A5           DB      $02
03A6           DB      $69
03A7           DB      $02
03A8           DB      $6A
03A9           DB      $01
03AA           DB      $6B
03AB           DB      $03
03AC           DB      $6C
03AD           DB      $01
03AE           DB      $86
03AF           DB      $01
03B0           DB      $88
03B1           DB      $01
03B2           DB      $8A
03B3           DB      $04
03B4           DB      $8C
03B5           DB      $04
03B6           DB      $A6
03B7           DB      $09
03B8           DB      $A7
03B9           DB      $02
03BA           DB      $A8
03BB           DB      $01
03BC           DB      $A9
03BD           DB      $03
03BE           DB      $C6
03BF           DB      $01
03C0           DB      $C8
03C1           DB      $04
03C2           DB      $E6
03C3           DB      $06
03C4           DB      $E7
03C5           DB      $02
03C6           DB      $E8
03C7           DB      $02
03C8           DB      $E9
03C9           DB      $03
				; ########### DATA TABLE #2 03CA-0411 ############
03CA           DB      $BD
03CB           DB      $BD
03CC           DB      $BD
03CD           DB      $BD
03CE           DB      $BD
03CF           DB      $BD
03D0           DB      $BD
03D1           DB      $BD
03D2           DB      $FF
03D3           DB      $00
03D4           DB      $FF
03D5           DB      $FF
03D6           DB      $FF
03D7           DB      $FF
03D8           DB      $00
03D9           DB      $FF
03DA           DB      $FC
03DB           DB      $04
03DC           DB      $F4
03DD           DB      $E4
03DE           DB      $C8
03DF           DB      $90
03E0           DB      $20
03E1           DB      $C0
03E2           DB      $BD
03E3           DB      $B9
03E4           DB      $B2
03E5           DB      $A4
03E6           DB      $88
03E7           DB      $F0
03E8           DB      $00
03E9           DB      $00
03EA           DB      $FF
03EB           DB      $80
03EC           DB      $BF
03ED           DB      $BF
03EE           DB      $BF
03EF           DB      $BF
03F0           DB      $BC
03F1           DB      $BD
03F2           DB      $BD
03F3           DB      $BC
03F4           DB      $BF
03F5           DB      $BF
03F6           DB      $BF
03F7           DB      $BF
03F8           DB      $80
03F9           DB      $FF
03FA           DB      $FF
03FB           DB      $01
03FC           DB      $FD
03FD           DB      $FD
03FE           DB      $FD
03FF           DB      $FD
0400           DB      $3D
0401           DB      $BD
0402           DB      $FF
0403           DB      $00
0404           DB      $FF
0405           DB      $FF
0406           DB      $FF
0407           DB      $FF
0408           DB      $3C
0409           DB      $BD
040A           DB      $BD
040B           DB      $BC
040C           DB      $BF
040D           DB      $BF
040E           DB      $BF
040F           DB      $BF
0410           DB      $BC
0411           DB      $BD
				; ##########
0412           DB      $00
0413           DB      $00
0414           DB      $00
0415           DB      $00
0416           DB      $00
0417           DB      $00
0418           DB      $00
0419           DB      $00
041A           DB      $00
041B           DB      $00
041C           DB      $00
041D           DB      $10
041E           DB      $00
041F           DB      $00
0420           DB      $00
0421           DB      $00
0422           DB      $00
0423           DB      $00
0424           DB      $10
0425           DB      $38
0426           DB      $10
0427           DB      $00
0428           DB      $00
0429           DB      $00
042A           DB      $00
042B           DB      $10
042C           DB      $38
042D           DB      $7C
042E           DB      $38
042F           DB      $10
0430           DB      $00
0431           DB      $00
0432           DB      $1F
0433           DB      $3F
0434           DB      $38
0435           DB      $38
0436           DB      $E1
0437           DB      $F3
0438           DB      $73
0439           DB      $73
043A           DB      $FE
043B           DB      $FF
043C           DB      $80
043D           DB      $80
043E           DB      $1F
043F           DB      $3F
0440           DB      $03
0441           DB      $03
0442           DB      $F0
0443           DB      $F9
0444           DB      $81
0445           DB      $81
0446           DB      $FF
0447           DB      $FF
0448           DB      $C0
0449           DB      $C0
044A           DB      $1F
044B           DB      $9F
044C           DB      $1C
044D           DB      $1C
044E           DB      $C1
044F           DB      $F1
0450           DB      $39
0451           DB      $39
0452           DB      $C7
0453           DB      $C7
0454           DB      $C7
0455           DB      $C7
0456           DB      $3F
0457           DB      $3F
0458           DB      $38
0459           DB      $38
045A           DB      $F3
045B           DB      $F1
045C           DB      $70
045D           DB      $70
045E           DB      $FE
045F           DB      $FF
0460           DB      $07
0461           DB      $07
0462           DB      $03
0463           DB      $03
0464           DB      $03
0465           DB      $03
0466           DB      $81
0467           DB      $81
0468           DB      $81
0469           DB      $81
046A           DB      $FC
046B           DB      $FC
046C           DB      $C0
046D           DB      $C0
046E           DB      $1F
046F           DB      $1F
0470           DB      $1C
0471           DB      $1C
0472           DB      $F0
0473           DB      $E0
0474           DB      $70
0475           DB      $38
0476           DB      $EE
0477           DB      $7C
0478           DB      $38
0479           DB      $38
047A           DB      $38
047B           DB      $38
047C           DB      $38
047D           DB      $00
047E           DB      $70
047F           DB      $73
0480           DB      $71
0481           DB      $00
0482           DB      $07
0483           DB      $FF
0484           DB      $FE
0485           DB      $00
0486           DB      $03
0487           DB      $03
0488           DB      $03
0489           DB      $00
048A           DB      $81
048B           DB      $81
048C           DB      $80
048D           DB      $00
048E           DB      $C0
048F           DB      $FF
0490           DB      $FF
0491           DB      $00
0492           DB      $1C
0493           DB      $9C
0494           DB      $1C
0495           DB      $00
0496           DB      $38
0497           DB      $38
0498           DB      $38
0499           DB      $00
049A           DB      $38
049B           DB      $38
049C           DB      $38
049D           DB      $00
049E           DB      $00
049F           DB      $30
04A0           DB      $70
04A1           DB      $70
04A2           DB      $00
04A3           DB      $03
04A4           DB      $07
04A5           DB      $07
04A6           DB      $00
04A7           DB      $FC
04A8           DB      $FE
04A9           DB      $00
04AA           DB      $00
04AB           DB      $1F
04AC           DB      $3F
04AD           DB      $38
04AE           DB      $00
04AF           DB      $E1
04B0           DB      $F3
04B1           DB      $00
04B2           DB      $00
04B3           DB      $FF
04B4           DB      $FF
04B5           DB      $38
04B6           DB      $00
04B7           DB      $1F
04B8           DB      $9F
04B9           DB      $1C
04BA           DB      $00
04BB           DB      $C0
04BC           DB      $F1
04BD           DB      $39
04BE           DB      $00
04BF           DB      $FF
04C0           DB      $FF
04C1           DB      $C3
04C2           DB      $00
04C3           DB      $1C
04C4           DB      $9C
04C5           DB      $9E
04C6           DB      $00
04C7           DB      $38
04C8           DB      $38
04C9           DB      $38
04CA           DB      $00
04CB           DB      $FE
04CC           DB      $FE
04CD           DB      $38
04CE           DB      $00
04CF           DB      $1F
04D0           DB      $3F
04D1           DB      $38
04D2           DB      $00
04D3           DB      $E1
04D4           DB      $F3
04D5           DB      $03
04D6           DB      $00
04D7           DB      $FE
04D8           DB      $FF
04D9           DB      $80
04DA           DB      $70
04DB           DB      $70
04DC           DB      $70
04DD           DB      $70
04DE           DB      $07
04DF           DB      $07
04E0           DB      $07
04E1           DB      $07
04E2           DB      $00
04E3           DB      $F0
04E4           DB      $F0
04E5           DB      $00
04E6           DB      $38
04E7           DB      $38
04E8           DB      $38
04E9           DB      $38
04EA           DB      $00
04EB           DB      $00
04EC           DB      $00
04ED           DB      $00
04EE           DB      $38
04EF           DB      $38
04F0           DB      $38
04F1           DB      $38
04F2           DB      $1C
04F3           DB      $1F
04F4           DB      $1F
04F5           DB      $1C
04F6           DB      $39
04F7           DB      $F1
04F8           DB      $E1
04F9           DB      $71
04FA           DB      $C3
04FB           DB      $C3
04FC           DB      $C3
04FD           DB      $C3
04FE           DB      $9F
04FF           DB      $9F
0500           DB      $9D
0501           DB      $9C
0502           DB      $38
0503           DB      $B8
0504           DB      $F8
0505           DB      $F8
0506           DB      $38
0507           DB      $38
0508           DB      $38
0509           DB      $38
050A           DB      $38
050B           DB      $38
050C           DB      $38
050D           DB      $38
050E           DB      $03
050F           DB      $03
0510           DB      $01
0511           DB      $00
0512           DB      $80
0513           DB      $FE
0514           DB      $FF
0515           DB      $07
0516           DB      $70
0517           DB      $70
0518           DB      $7F
0519           DB      $3F
051A           DB      $07
051B           DB      $07
051C           DB      $E7
051D           DB      $C3
051E           DB      $00
051F           DB      $00
0520           DB      $FE
0521           DB      $FC
0522           DB      $38
0523           DB      $38
0524           DB      $3F
0525           DB      $1F
0526           DB      $00
0527           DB      $00
0528           DB      $F0
0529           DB      $E0
052A           DB      $38
052B           DB      $38
052C           DB      $38
052D           DB      $38
052E           DB      $1C
052F           DB      $1C
0530           DB      $1C
0531           DB      $1C
0532           DB      $39
0533           DB      $39
0534           DB      $39
0535           DB      $38
0536           DB      $C3
0537           DB      $C3
0538           DB      $FF
0539           DB      $FF
053A           DB      $9C
053B           DB      $9C
053C           DB      $9C
053D           DB      $1C
053E           DB      $78
053F           DB      $38
0540           DB      $38
0541           DB      $38
0542           DB      $38
0543           DB      $38
0544           DB      $FE
0545           DB      $FE
0546           DB      $38
0547           DB      $38
0548           DB      $3F
0549           DB      $1F
054A           DB      $00
054B           DB      $00
054C           DB      $F3
054D           DB      $E1
054E           DB      $07
054F           DB      $07
0550           DB      $FF
0551           DB      $FE
				; ################## START CP/M LOADING ROUTINE ####################
0552           IN      A,($FD)	; read 1 byte from 8272 Data Register, it should be 80 (result of the
				; invalid command sent to 8272 by the instruction at 002A).
0554           CP      $80	; This tests whether 8272 present and properly reset.
0556           JP      NZ,$0004	; if not 80, restart execution from the beginning of the BOOT EPROM	---@@@0558:00->28
0559           LD      HL,$0561
055C           LD      A,$41
055E           JP      $0051	; (see comments for code at 0051)					---@@@0560:00->28
;				; after the jump, "41" is written to 8255 Port C which means:
				; signal "O6" set to 1, "O5" set to 0, border color set to blue;
				; then bit 7 of register R is reset to 0 by instruction "LD R,A"
				; and configuration is changed to CP/M ("O6"=1). In this new config
				; execution starts from address stored in register HL previously.
				; The entire BOOT EPROM code was previously copied to beginning of DRAM#0
				; (see comments at 001D) and DRAM#0 is located at 0000 in CP/M config
				; so HL points now to exactly the next instruction below.
0561           LD      A,$01
0563           OUT     ($FE),A
0565           LD      HL,$0000
0568           LD      DE,$F800
056B           LD      BC,$0800
056E           LDIR    
0570           JP      $FD73
0573           IM      2
0575           LD      HL,$FFE8
0578           LD      A,H
0579           LD      I,A
057B           LD      A,L
057C           OUT     ($E3),A
057E           LD      A,$FF
0580           OUT     ($E3),A
0582           LD      A,$01
0584           OUT     ($E3),A
0586           LD      HL,$FFE4
0589           CALL    $FF0B
058C           LD      B,$04
058E           PUSH    BC
058F           LD      BC,$0204
0592           CALL    $FEBD
0595           CALL    $FEF9
0598           POP     BC
0599           LD      A,($FFD5)
059C           BIT     5,A
059E           JR      NZ,$05B6
05A0           LD      HL,$FF95
05A3           INC     (HL)
05A4           DJNZ    $058E
05A6           DI      
05A7           IM      0
05A9           XOR     A
05AA           LD      I,A
05AC           LD      HL,$0004	;									---@@@05AE:00->28
05AF           LD      A,$C1
05B1           OUT     ($FE),A
05B3           LD      R,A
05B5           JP      (HL)
05B6           LD      BC,$0207
05B9           CALL    $FEBD
05BC           CALL    $FF40
05BF           CALL    $FF31
05C2           LD      BC,$024A
05C5           CALL    $FEBD
05C8           CALL    $FEF9
05CB           LD      A,($FFD5)
05CE           AND     $C0
05D0           JR      Z,$05E3
05D2           LD      HL,$FFAC
05D5           LD      DE,$FF99
05D8           LD      BC,$000A
05DB           LDIR    
05DD           LD      HL,$FFE6
05E0           CALL    $FF0B
05E3           LD      A,($FF99)
05E6           OR      A
05E7           LD      B,$04
05E9           LD      E,$01
05EB           JR      NZ,$05EF
05ED           LD      B,$10
05EF           CALL    $FF54
05F2           INC     E
05F3           DJNZ    $05EF
05F5           LD      HL,$0000
05F8           LD      ($FFD0),HL
05FB           LD      HL,$F400
05FE           PUSH    HL
05FF           POP     HL
0600           LD      B,$40
0602           LD      A,(HL)
0603           OR      A
0604           JR      NZ,$061A
0606           PUSH    BC
0607           PUSH    HL
0608           LD      DE,$0009
060B           ADD     HL,DE
060C           EX      DE,HL
060D           LD      HL,$FFDE
0610           LD      B,$03
0612           LD      A,(DE)
0613           AND     $7F
0615           CP      (HL)
0616           JR      Z,$0622
0618           POP     HL
0619           POP     BC
061A           LD      DE,$0020
061D           ADD     HL,DE
061E           DJNZ    $0602
0620           JR      $05A6
0622           INC     DE
0623           INC     HL
0624           DJNZ    $0612
0626           POP     DE
0627           LD      HL,$0010
062A           ADD     HL,DE
062B           LD      DE,$FC00
062E           PUSH    DE
062F           LD      BC,$0010
0632           LDIR    
0634           EX      (SP),HL
0635           LD      A,(HL)
0636           PUSH    HL
0637           LD      H,$00
0639           LD      L,A
063A           LD      BC,$03FF
063D           SLA     L
063F           RL      H
0641           DJNZ    $063D
0643           INC     HL
0644           LD      DE,($FF9F)
0648           INC     C
0649           SBC     HL,DE
064B           JR      NC,$0648
064D           ADD     HL,DE
064E           LD      A,($FF99)
0651           OR      A
0652           LD      B,$08
0654           JR      Z,$065E
0656           LD      B,$02
0658           DEC     L
0659           SRL     L
065B           SRL     L
065D           INC     L
065E           LD      A,$02
0660           ADD     A,C
0661           LD      D,A
0662           LD      E,L
0663           LD      A,D
0664           LD      ($FFD4),A
0667           CALL    $FF54
066A           LD      HL,($FF9A)
066D           INC     HL
066E           INC     E
066F           LD      A,E
0670           CP      L
0671           JR      C,$0676
0673           INC     D
0674           LD      E,$01
0676           DJNZ    $0663
0678           POP     HL
0679           INC     HL
067A           LD      A,$0F
067C           AND     L
067D           JR      Z,$05FF
067F           LD      A,(HL)
0680           OR      A
0681           JR      NZ,$0636
0683           DI      
0684           LD      HL,$0000
0687           LD      A,(HL)
0688           CP      $F3
068A           EXX     
068B           LD      HL,$0043
068E           JP      Z,$FDAF
0691           EXX     
0692           JP      (HL)
0693           EX      AF,AF'
0694           LD      A,$7F
0696           OUT     ($EB),A
0698           LD      A,($FF9E)
069B           OUT     ($EB),A
069D           EX      AF,AF'
069E           EI      
069F           RETI    

06A1           INI     
06A3           EI      
06A4           RETI    

06A6           LD      ($FFD2),HL
06A9           LD      HL,$FE93
06AC           LD      ($FFE8),HL
06AF           LD      C,$00
06B1           EI      
06B2           RETI    

06B4           IN      A,($F5)
06B6           BIT     7,A
06B8           JR      Z,$06B4
06BA           BIT     6,A
06BC           RET     

06BD           LD      HL,$FF95
06C0           CALL    $FEB4
06C3           JP      NZ,$FDA6
06C6           LD      A,C
06C7           OUT     ($FD),A
06C9           LD      C,(HL)
06CA           INC     HL
06CB           DJNZ    $06C0
06CD           RET     

06CE           LD      DE,$FF95
06D1           LD      HL,$FEA1
06D4           LD      ($FFE8),HL
06D7           LD      HL,($FFD0)
06DA           JR      $06DF
06DC           LD      A,(DE)
06DD           INC     DE
06DE           LD      C,A
06DF           CALL    $FEB4
06E2           JP      NZ,$FDA6
06E5           LD      A,C
06E6           LD      C,$FD
06E8           OUT     (C),A
06EA           DJNZ    $06DC
06EC           HALT    
06ED           IN      A,($F5)
06EF           AND     $20
06F1           JR      NZ,$06EC
06F3           LD      HL,$FE93
06F6           LD      ($FFE8),HL
06F9           LD      HL,$FFD5
06FC           LD      B,$08
06FE           CALL    $FEB4
0701           RET     Z

0702           IN      A,($FD)
0704           LD      (HL),A
0705           INC     HL
0706           DJNZ    $06FE
0708           JP      $FDA6
070B           DI      
070C           LD      A,$7F
070E           OUT     ($EB),A
0710           LD      A,($FF9E)
0713           OUT     ($EB),A
0715           LD      A,$FF
0717           OUT     ($F3),A
0719           LD      A,($FF9D)
071C           OUT     ($F3),A
071E           EI      
071F           LD      BC,$0303
0722           JR      $06C0
0724           LD      BC,$0108
0727           CALL    $FEBD
072A           CALL    $FEF9
072D           LD      A,($FFD5)
0730           RET     

0731           LD      A,($FFD4)
0734           LD      HL,$FF96
0737           CP      (HL)
0738           RET     Z

0739           LD      (HL),A
073A           LD      BC,$030F
073D           CALL    $FEBD
0740           CALL    $FF24
0743           BIT     5,A
0745           JR      Z,$0740
0747           AND     $D8
0749           JP      NZ,$FDA6
074C           CALL    $FF24
074F           CP      $80
0751           RET     Z

0752           JR      $074C
0754           PUSH    BC
0755           PUSH    DE
0756           CALL    $FF31
0759           LD      D,$00
075B           LD      HL,($FFA1)
075E           ADD     HL,DE
075F           LD      A,(HL)
0760           LD      ($FF98),A
0763           LD      B,$0A
0765           PUSH    BC
0766           LD      A,($FF99)
0769           OR      A
076A           LD      BC,$0906
076D           JR      Z,$0771
076F           SET     6,C
0771           CALL    $FECE
0774           XOR     A
0775           OR      C
0776           POP     BC
0777           JR      NZ,$0787
0779           LD      HL,$FFD7
077C           LD      A,(HL)
077D           DEC     HL
077E           OR      (HL)
077F           JR      NZ,$0787
0781           DEC     HL
0782           LD      A,(HL)
0783           AND     $D8
0785           JR      Z,$078C
0787           DJNZ    $0765
0789           JP      $FDA6
078C           LD      HL,($FFD2)
078F           LD      ($FFD0),HL
0792           POP     DE
0793           POP     BC
0794           RET     

0795           DB      $00
0796           DB      $00
0797           DB      $00
0798           DB      $01
0799           DB      $02
079A           DB      $09
079B           DB      $2A
079C           DB      $FF
079D           DB      $02
079E           DB      $00
079F           DB      $24
07A0           DB      $00
07A1           DB      $A2
07A2           DB      $FF
07A3           DB      $01
07A4           DB      $05
07A5           DB      $09
07A6           DB      $04
07A7           DB      $08
07A8           DB      $03
07A9           DB      $07
07AA           DB      $02
07AB           DB      $06
07AC           DB      $00
07AD           DB      $1A
07AE           DB      $07
07AF           DB      $80
07B0           DB      $01
07B1           DB      $80
07B2           DB      $1A
07B3           DB      $00
07B4           DB      $B5
07B5           DB      $FF
07B6           DB      $01
07B7           DB      $07
07B8           DB      $0D
07B9           DB      $13
07BA           DB      $19
07BB           DB      $05
07BC           DB      $0B
07BD           DB      $11
07BE           DB      $17
07BF           DB      $03
07C0           DB      $09
07C1           DB      $0F
07C2           DB      $15
07C3           DB      $02
07C4           DB      $08
07C5           DB      $0E
07C6           DB      $14
07C7           DB      $1A
07C8           DB      $06
07C9           DB      $0C
07CA           DB      $12
07CB           DB      $18
07CC           DB      $04
07CD           DB      $0A
07CE           DB      $10
07CF           DB      $16
07D0           DB      $00
07D1           DB      $F4
07D2           DB      $00
07D3           DB      $F4
07D4           DB      $02
07D5           DB      $00
07D6           DB      $00
07D7           DB      $00
07D8           DB      $00
07D9           DB      $00
07DA           DB      $00
07DB           DB      $00
07DC           DB      $00
07DD           DB      $00
07DE           DB      $53
07DF           DB      $59
07E0           DB      $53
07E1           DB      $00
07E2           DB      $00
07E3           DB      $00
07E4           DB      $EF
07E5           DB      $01
07E6           DB      $EF
07E7           DB      $17
07E8           DB      $93
07E9           DB      $FE
07EA           DB      $9E
07EB           DB      $FE
07EC           DB      $A6
07ED           DB      $FE
07EE           DB      $9E
07EF           DB      $FE
07F0           LD      A,$0F
07F2           OUT     ($DF),A	; set bit 7 of port C 8255 (SO)
07F4           LD      HL,$0000
07F7           EXX     
07F8           RST     $38	;								---@@@07F8:FFFFFF->C33828
07F9           RST     $38
07FA           RST     $38
07FB           RST     $38
07FC           RST     $38
07FD           RST     $38
07FE           RST     $38
07FF           RST     $38
